package rjeutsky.ui;

import java.util.Scanner;

public class StringConsoleRequest extends ConsoleRequest<String> {

	private boolean isAllowsEmpty;
	
	@Override
	protected void queryConsole() {
		Scanner scanner = new Scanner(input);
		String line = scanner.nextLine();
		while(!isAllowsEmpty && line.equals("")){
			line = scanner.nextLine();
		}
		value = line;
	}

	public void setAllowsEmpty(boolean isAllowsEmpty) {
		this.isAllowsEmpty = isAllowsEmpty;
	}

	public boolean isAllowsEmpty() {
		return isAllowsEmpty;
	}
	
}
